package com.itheima.web.job;

import com.itheima.service.db.AnalysisByDayService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

// 日志统计定时任务类
@Component
public class AnalysisJob {

    @Reference
    private AnalysisByDayService analysisByDayService;

   @Scheduled(cron = "0 0 0/1 * * ?") // 每小时
    // @Scheduled(cron = "0 0/1 * * * ?") // 每分钟
    public void analysis() {
        // 开启日志统计
        analysisByDayService.analysis();

        System.out.println("日志统计完成了。。。");
    }
}
